<ion-header>
  <ion-toolbar class="orange-bar">
    <ion-buttons slot="start">
      <ion-button color="light" (click)="doPop()">
        <ion-icon name="ios-arrow-back"></ion-icon>
      </ion-button>
    </ion-buttons>
    <ion-title>{{data['title']}}({{data['bidNo']}})</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>

  <header padding-horizontal padding-top class="bg-orange">
    <div>
      <span style="font-size: 12px">投标金额(元)</span>
      <a float-right [routerLink]="['/auth/user-loan-bill', {bidId: data['bidId'], bidNo: data['bidNo'], title: data['title'], userRole: 2}]">
        <ion-text color="light">
          查看账单
          <ion-icon name="ios-arrow-forward" style="position: relative; top: 2px"></ion-icon>
        </ion-text>
      </a>
    </div>
    <h3>{{data.amount | number:'.2'}}</h3>
    <div>
      <span style="font-size: 12px">参考年回报率(%)</span>
      <a float-right (click)="openContract()">
        <ion-text color="light">
          合同信息
          <ion-icon name="ios-arrow-forward" style="position: relative; top: 2px"></ion-icon>
        </ion-text>
      </a>
    </div>
    <h3>{{data['apr'] | number:'.2'}}</h3>
  </header>

  <ion-list>
    <ion-item>
      <ion-label>
        <span>期限</span>
      </ion-label>
      <span slot="end">{{data['period']}}{{data['periodUnit']}}</span>
    </ion-item>
    <ion-item>
      <ion-label>
        <span>还款方式</span>
      </ion-label>
      <span slot="end">{{data['repaymentType']}}</span>
    </ion-item>
    <ion-item>
      <ion-label>
        <span>放款时间</span>
      </ion-label>
      <span slot="end">{{data['releaseTime'] ? (data['releaseTime'] | date:'yyyy-MM-dd HH:mm:ss') : '---'}}</span>
    </ion-item>
    <ion-item>
      <ion-label>
        <span>状态</span>
      </ion-label>
      <span slot="end">{{data['statusStr']}}</span>
    </ion-item>
    <!--<ion-item detail (click)="goLoanUpload()">-->
      <!--<ion-label>-->
        <!--<span class="color-orange">审核科目</span>-->
      <!--</ion-label>-->
      <!--<ion-buttons slot="end">-->
        <!--<ion-button color="tertiary">查看</ion-button>-->
      <!--</ion-buttons>-->
    <!--</ion-item>-->
    <ion-item detail (click)="doPreRepay()">
      <ion-label>
        <span class="color-orange">提前还款</span>
      </ion-label>
      <ion-buttons slot="end">
        <ion-button color="tertiary" *ngIf="data['isPreRepay']; else canNotPreRepayBlock">申请</ion-button>
        <ng-template #canNotPreRepayBlock>
          <ion-button color="tertiary" disabled>{{data['status'] === 5 ? '已还款' : '当前状态不可申请'}}</ion-button>
        </ng-template>
      </ion-buttons>
    </ion-item>
  </ion-list>

</ion-content>
